import org.springframework.beans.factory.DisposableBean;

import javax.annotation.PreDestroy;

public class Person implements DisposableBean {

    String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 初始化方法
     */
    public void init() {
        System.out.println("Person.initialize");
    }

    /**
     * 销毁方法
     */
    public void destroy_1() {
        System.out.println("Person.destroy_1");
    }

    /**
     * 销毁方法
     */
    @PreDestroy
    public void destroy_2() {
        System.out.println("Person.destroy_2");

    }

    @Override
    public void destroy() throws Exception {
        System.out.println("Person.destroy");
    }

}
